<template>
    <div class="west-medical">
        <div class="tcon text-center">
            <barcode :value="mdata.recipeNo" style="width:80%;height:80px;margin-top:1em;" :options="{ displayValue: false }"></barcode>
            <span>No.{{mdata.recipeNo}}</span>
            <div class="flag"><span>普通处方</span></div>
        </div>
        <div class="fcon">
            <ul>
                <li>
                    <div>处方日期 </div>
                    <div>{{mdata.recipeDate | cut(10)}}（有效期3天）</div>
                </li>
                <li>
                    <div>姓名 </div>
                    <div class="name"><span>{{mdata.patientName}}</span>
                    <!-- <span>女</span> <span>25岁</span> -->
                    </div>
                </li>
                <li>
                    <div>病案号 </div>
                    <div>{{mdata.patientCode}}</div>
                </li>
                <li>
                    <div> 科室 </div>
                    <div>{{mdata.departmentName}}</div>
                </li>
            </ul>
        </div>
        <div class="mt10"></div>
        <div class="scon">
            <div class="rpicon" v-show="mdata.recipeType !=='3'"></div>
            <div class="item-con">
                <div v-for="(item, i) in mdata.drugItems" :key="i">
                    <template v-if="mdata.recipeType ==='3'">
                        <div class="item-left">
                            <div>{{item.drugName}} </div>
                            <div>
                                <span>
                                    每日{{item.daytimes}}次
                                </span>
                                <span>{{item.frequencyName}}</span></div>
                        </div>
                        <div class="item-right">{{item.quantity + item.unit}}</div>
                    </template>
                    <template v-else>
                        <div class="item-left">
                            <span class="ind">{{(i+1)}}</span>
                            <div>{{item.drugName}} {{item.specification}}</div>
                            <span v-if="item.tips">用法:{{item.tips}}</span>
                            <div v-else>
                                <span>用法:</span>
                                <span>每次{{item.dose}}{{item.doseUnit}}</span>
                                <span>{{item.frequencyName}}</span>
                                <span>{{item.usage}}</span>
                            </div>
                        </div>
                        <div class="item-right">{{item.quantity + item.unit}}</div>
                    </template>
                </div>

            </div>
        </div>
        <div class="mt10"></div>
        <div class="bgwhite">
            <mu-list>
                <mu-list-item title="">
                    <span slot="left" class="ltxt">药费</span>
                    <span slot="left" class="feeText">{{mdata.totalAmount | fixedMoney}}</span>
                </mu-list-item>
                <mu-divider/>
                <mu-list-item title="">
                    <span slot="left" class="ltxt">处方医师</span>
                    <span slot="left" class="ltxt1">{{mdata.doctorName}}</span>
                  <span slot="right" class="ltxt">审核发药药师</span>
                  <span slot="right" class="ltxt1" v-html="mdata.username || '暂无'"></span>
                    <!--<span slot="right" class="ltxt">审核药师</span>-->
                    <!--<span slot="right" class="ltxt1" v-html="mdata.auditors || '暂无'"></span>-->
                </mu-list-item>
                <!--<mu-list-item title="">-->
                  <!---->
                <!--</mu-list-item>-->
            </mu-list>
        </div>
    </div>
</template>

<script>
  import barcode from '@xkeshi/vue-barcode'

export default {
  data() {
    return {};
  },
  props: ['mdata'],
  components: {barcode},
  methods: {},
  mounted() {}
};
</script>

<style lang="less" scoped>
@import "../../common/css/flex.css";
@import "../../common/css/component";
.west-medical {
  width: 100%;
  background: #f2f2f2;
  @{deep} .mu-item-left {
    width: auto;
  }
  @{deep} .mu-item.show-left {
    padding-left: 60px;
  }
  @{deep} .mu-item-title {
    color: #666;
    font-size: 14px;
  }
  @{deep} .mu-item-text {
    color: #ccc;
  }
  @{deep} .mu-item-right {
    color: #333;
    font-size: 14px;
  }
  @{deep} .mu-item {
    min-height: 44px;
  }
}

.tcon {
  border-top: 1px solid #e8e8e8;
  width: 100%;
  padding: 15px;
  color: #666;
  font-size: 14px;
  background: #f8f8f8;
  position: relative;
  > img {
    display: block;
    width: 60%;
    height: 40px;
  }
  > span {
    display: block;
    font-size: 12px;
    color: #333;
    padding-top: 10px;
  }
  .flag {
    position: absolute;
    top: 0;
    right: 25px;
    width: 60px;
    height: 30px;
    background: transparent url("../../assets/fzhis/tag_bg.png") no-repeat
      center center/100% 100%;
    text-align: center;
    color: #fff;
    font-size: 12px;
    padding-top: 3px;
  }
}

.fcon {
  padding: 15px;
  background: #fff;
  border-top: 1px solid #e8e8e8;
  > ul {
    > li + li {
      margin-top: 5px;
    }
    > li {
      display: table;
      > div {
        display: table-cell;
        font-size: 14px;
      }
      > div:first-child {
        color: #666;
        width: 5em;
        white-space: nowrap;
        padding-right: 15px;
      }
      > div:last-child {
        color: #333;
      }
      > div.name {
        > span:not(:first-child) {
          font-size: 12px;
          padding-left: 5px;
          color: #999;
        }
      }
    }
  }
}

.ltxt {
  white-space: nowrap;
  color: #666;
  padding-right: 10px;
  font-size: 14px;
}

.ltxt1 {
  white-space: nowrap;
  color: #333;
  font-size: 14px;
}

.scon {
  border-top: 1px solid #e8e8e8;
  width: 100%;
  background: #fff;
  color: #666;
  font-size: 14px;
  padding: 15px;
  padding-left: 40px;
  .rpicon {
    width: 100%;
    height: 25px;
    background: transparent url("../../assets/fzhis/icon_rp.png") no-repeat left
      center/80px 25px;
    margin-left: -24px;
  }
  .item-con {
    margin-top: 15px;
    background: #fff;
    font-size: 14px;
    color: #333;
    > div + div {
      margin-top: 10px;
    }
    > div {
      width: 100%;
      position: relative;
      display: table;
      > div {
        display: table-cell;
      }
    }
  }
  .item-right {
    text-align: right;
    white-space: nowrap;
  }
  .item-left {
    position: relative;
    > span.ind {
      position: absolute;
      top: 0px;
      left: -25px;
      width: 18px;
      height: 18px;
      line-height: 18px;
      background: #2abc6d;
      color: white;
      border-radius: 50%;
      text-align: center;
    }
    > div:nth-child(2) {
      color: #999;
      > span + span {
        padding-left: 5px;
      }
    }
  }
}
</style>
